<!--
    -  Copyright (c) 2018-2025, haohanwork.com All rights reserved.
  -->
<template>
  <div class="execution">
    <basic-container class="title">应付账单结算</basic-container>
    <basic-container>
      <h2 class="io-goods-detail">
        基础信息
      </h2>
      <template>
        <el-row class="io-goods-detail basic-information">
          <el-col :span="6"><div class="grid-content bg-purple">结算单号:{{basicInformation.purchaseOrderId}}</div></el-col>
          <el-col :span="6"><div class="grid-content bg-purple-light">客户名称:{{basicInformation.checkStatus}}</div></el-col>
          <el-col :span="6"><div class="grid-content bg-purple">收款人:</div></el-col>
        </el-row>
        <el-row class="io-goods-detail basic-information">
          <el-col :span="6"><div class="grid-content bg-purple">制单人:{{basicInformation.purchaseOrderId}}</div></el-col>
          <el-col :span="6"><div class="grid-content bg-purple-light">单据金额:{{basicInformation.checkStatus}}</div></el-col>
          <el-col :span="6"><div class="grid-content bg-purple">支付方式:</div></el-col>
        </el-row>
        <el-row class="io-goods-detail basic-information">
          <el-col :span="6"><div class="grid-content bg-purple">单据状态:{{basicInformation.purchaseOrderId}}</div></el-col>
          <el-col :span="6"><div class="grid-content bg-purple-light">创建日期:{{basicInformation.checkStatus}}</div></el-col>
          <el-col :span="6"><div class="grid-content bg-purple">本次付款金额:</div></el-col>
        </el-row>
        <el-row class="io-goods-detail basic-information">
          <el-col :span="6"><div class="grid-content bg-purple">类型:{{basicInformation.purchaseOrderId}}</div></el-col>
          <el-col :span="6"><div class="grid-content bg-purple-light">原采购订单:{{basicInformation.checkStatus}}</div></el-col>
          <el-col :span="6"><div class="grid-content bg-purple-light">采购员:{{basicInformation.checkStatus}}</div></el-col>
        </el-row>
        <el-row class="io-goods-detail basic-information">
          <el-col :span="6"><div class="grid-content bg-purple">采购类型:{{basicInformation.purchaseOrderId}}</div></el-col>
        </el-row>
      </template>
    </basic-container>
    <basic-container>
      <h2 class="io-goods-detail">
        采购单列表
      </h2>
      <template>
        <el-table
          :data="tableData"
          style="width: 100%"
          :header-cell-style="{background:'#eef1f6',color:'#606266'}">
          <el-table-column
            label="序号"
            prop="id"
            align="center"
            type="index">
          </el-table-column>
          <el-table-column
            label="商品名称"
            prop="productName"
            align="center">
          </el-table-column>
          <el-table-column
            label="单位"
            prop="unit"
            align="center">
          </el-table-column>
          <el-table-column
            label="发货数量"
            prop="shipmentNum"
            align="center">
          </el-table-column>
          <el-table-column
            label="发货单价"
            prop="univalenc"
            align="center">
          </el-table-column>
          <el-table-column
            label="发货金额"
            prop="money"
            align="center">
          </el-table-column>
        </el-table>
      </template>
    </basic-container>
    <basic-container>
      <h2 class="io-goods-detail">
        其他费用扣减
      </h2>
      <template>
          <el-form :inline="true" :model="formInline" class="demo-form-inline">
            <el-form-item label="扣减金额">
              <el-input v-model="deduction.money" placeholder="0"></el-input>
            </el-form-item><span class="yuan">元</span>
            <el-form-item label="扣减名称：">
              <el-input v-model="deduction.name" placeholder="扣减名称"></el-input>
            </el-form-item>
            <el-form-item label="备注">
              <el-input v-model="deduction.remarks" placeholder="请填写备注信息"></el-input>
            </el-form-item>
            <el-form-item>
              <el-button type="primary" @click="onSubmit">添加+</el-button>
            </el-form-item>
          </el-form>
          <div style="border-bottom: 1px solid #eee; margin-top: 50px;"></div>
          <h3 class="settle-accounts">合计结算金额:{{calcMoney}}</h3>
      </template>
    </basic-container>

    <basic-container>
      <h2 class="io-goods-detail">
        上传凭证
      </h2>
      <template>
        <el-button type="primary" class="certificate">上传凭证</el-button>
        <p class="explain">仅支持jpg,jpeg,png格式，文件小于5M</p>
      </template>
      <template>
        <div class="return-btn">
          <el-button type="primary">确认付款</el-button>
          <el-button>取消</el-button>
        </div>
      </template>
    </basic-container>
  </div>
</template>
<!-- 采购退货 -->
<script>
  import {
    mapGetters
  } from 'vuex'
  export default {
    name: 'addpurchaseback',
    data() {
      return {
        deduction: {
          money: '',
          name: '',
          remarks:''
        },
        tableData: [
          {
            goodsImg:'http://i2.tiimg.com/684003/5bbcef207e546891.png',
            goods:'测试商品',
            unit:'斤',
            num:12,
            price:2.2,
            money:28.4,
            desc:''
          },{
            goodsImg:'http://i2.tiimg.com/684003/5bbcef207e546891.png',
            goods:'测试商品',
            unit:'斤',
            num:12,
            price:2.2,
            money:28.4,
            desc:''
          },{
            goodsImg:'http://i2.tiimg.com/684003/5bbcef207e546891.png',
            goods:'测试商品',
            unit:'斤',
            num:12,
            price:2.2,
            money:28.4,
            desc:''
          },
          {
            goodsImg:'http://i2.tiimg.com/684003/5bbcef207e546891.png',
            goods:'测试商品',
            unit:'斤',
            num:12,
            price:2.2,
            money:28.4,
            desc:''
          }
        ],
        otherMoney:100,
        calcMoney:1000,
        basicInformation:{
          purchaseOrderId:'POI10000',
          checkStatus:'待审核',
          purchaseType:'平台直购',
          supplierName:'浩瀚小店',
          deliveryTime:'2019-03-09',
          purchaseEmployee:'张**',
          makeBill:'运营'
        },
        operationalHistory:[
          {
            operatingTime:'2019-02-01 12:00',
            operator:'张**',
            type:'新增采购单',
            log:'已新增采购单'
          },
          {
            operatingTime:'2019-02-01 12:00',
            operator:'张**',
            type:'新增采购单',
            log:'已新增采购单'
          },
          {
            operatingTime:'2019-02-01 12:00',
            operator:'张**',
            type:'新增采购单',
            log:'已新增采购单'
          }
        ]
      }
    },
    computed: {
      ...mapGetters(['permissions'])
    },
    methods:{
      onSubmit() {
        console.log('submit!');
      }
    }
  }
</script>

<style lang="scss" scoped>
  .io-goods-detail{
    margin-left: 10px;
  }
  .settle-accounts{
    text-align: right;
  }
  .basic-information {
    margin-top: 20px;
    font-weight: inherit;
  }
  .return-btn{
    height: 100px;
    width: 100%;
    text-align: center;
    line-height: 100px;
  }
  .title{
    text-align: center;
    font-size: 26px;
  }
  .demo-form-inline{
    margin-top: 20px;
  }
  .yuan{
    display: inline-block;
    padding-right: 20px;
    line-height: 40px;
  }
  .settle-accounts{
    margin-top: 20px;
  }
  .certificate{
    margin-top: 20px;
  }
  .explain{
    font-size: 12px;
    color: #999;
  }

</style>
